

#include <inttypes.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>

# include "native_array.h"
# include "new.h"

void test_NativeArray()
{
    Object* array = new(NativeArray, 10, sizeof(size_t));
    setitem(array, 9, 42);
    setitem(array, 15, 42);
    setitem(array, 8, 42);
    setitem(array, 16, 42);
    printf("array = %s\n", str(array));
    //str(array);
    delete(array);
}

void test2_NativeArray()
{
    Object* array = new(NativeArray, 0, sizeof(uint64_t));
    for (int i=0; i < 100; i++) {
        push_back(array, ((uint64_t) i));
        push_back(array, ((uint64_t) rand()%100));
    }
    setitem(array, 30, 42);
    printf("array = %s, size = %u\n", str(array), size(array));
    delete(array);
}


int main()
{
    test_NativeArray();
    test2_NativeArray();
    return 0;
}
